package com.settlement.system.parse.formula;

/**
 * 多等式计算器
 *
 * @author Ximi
 * @since 2020/10/13
 */
public class MultiEqualsCalculator extends EqualsCalculator {

    public MultiEqualsCalculator(PlaceHoldParse placeHoldParse) {
        super(placeHoldParse);
    }

    @Override
    public Boolean calculate(String formula) {
        String[] formulas = formula.split(",");
        for (int index = 0; index < formulas.length; index++) {
            if (!super.calculate(formulas[index])) {
                return false;
            }
        }
        return true;
    }
}
